pbootcms会员中心 我的评论模板代码 mycomment.html
时间 :
2022-07-29
编辑 :超级管理员
我的评论
<table class="table">
<thead>
<th>序号</th>
<th>文章</th>
<th>评论</th>
<th>状态</th>
<th>时间</th>
<th>操作</th>
</thead>
<tbody>
{pboot:mycomment num=10}
<tr>
<td>[mycomment:i]</td>
<td>[mycomment:title]</td>
<td>[mycomment:comment]</td>
<td>{pboot@if([mycomment:status]==1)}已审核{else}<span style="color:red">待审核</span>{/pboot@if}</td>
<td>[mycomment:date]</td>
<td><span class="del" data-url="[mycomment:delaction]" style="cursor:pointer" >删除</span></td>
</tr>
{/pboot:mycomment}
</tbody>
</table>
<script>
$(".del").on("click",function(){
if(!confirm("您确定要删除么?")){
return;
}
var url=$(this).data('url');
var el=$(this).parents("tr");
$.ajax({
type: 'GET',
url: url,
dataType: 'json',
success: function (response, status) {
if(response.code==0){
alert(response.data);
}else{
el.remove();
}
},
error:function(xhr,status,error){
alert('返回数据异常!');
}
});
});
</script>
